﻿
using CSharpLibs.Annotations;

#pragma warning disable 0169

namespace System
{
	[Builtin]
	public struct Int16 : ISignIntegralValue, IComparable, IComparable<Int16>, IEquatable<Int16>
	{
		public const short MaxValue = 32767;
		public const short MinValue = -32768;

		[DummyPrimitiveField]
		private short ff;

		public int CompareTo(object o)
		{ return this.CompareTo((Int16)o); }

		public int CompareTo(Int16 sh)
		{
			if(this == sh)
				return 0;
			else if(this < sh)
				return -1;
			else
				return 1;
		}

		public override bool Equals(object o)
		{ return (o is Int16) && (this == ((Int16)o)); }

		public bool Equals(Int16 sh)
		{ return this == sh; }

		public override int GetHashCode()
		{ return (((ushort)this) ^ (((short)this) << 0x10)); }

		public static short Parse(string sv)
		{ return (short)PrimitiveHelper.ParseIntegral(sv); }

		public override string ToString()
		{ return PrimitiveHelper.IntegralToString(this); }
	}
}

#pragma warning restore 0169

